package com.hkg.springcloud.alibaba.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : ConfigController
 * @Author : 坏老爷
 * @Date: 2020-03-31 14:48
 */
@RestController
@Slf4j
@RefreshScope  // 实现配置自动更新
public class ConfigController {
    @Value("${config.info}")
    private String configInfo;

    @RequestMapping("/config/info")
    public String getConfigInfo() {
        return configInfo;
    }
}
